import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify';
import router from '@/router';
import store from '@/store';
import Utils from '@/common/utils'
import '@/assets/scss/app.scss'
import '@/plugins/vxe-table';
import initialization from '@/common/initialization';

Vue.config.productionTip = false
Vue.prototype.$utils = Utils

Vue.mixin({
	filters: {
		imageSrc(v) {
			if (!v) return v;
			return `${process.env.VUE_APP_BASE_API_URL}${v}`
		}
	},
})

initialization.init().finally(() => {
	switch (store.getters.mainTheme ) {
		case 'global':
			vuetify.framework.theme.light = false;
			vuetify.framework.theme.dark = false;
			require('@/assets/scss/theme/light.scss')
			break;
		case 'light':
			vuetify.framework.theme.light = true;
			vuetify.framework.theme.dark = false;
			require('@/assets/scss/theme/light.scss')
			break;
		case 'dark':
			vuetify.framework.theme.light = false;
			vuetify.framework.theme.dark = true;
			require('@/assets/scss/theme/dark.scss')
			break;
	}
	new Vue({
		vuetify,
		router,
		store,
		render: h => h(App)
	}).$mount('#app')
})
